#include "hourEmployee.h"
HourEmployee::HourEmployee(const string& nume,const string& prenume,const string& ssn,double h,double wag):Employee(nume,prenume,ssn){
setHour(h);setWage(wag);
}
double HourEmployee::getWage()const{return (*this).wage;}
double HourEmployee::getHour()const{return (*this).hour;}

void HourEmployee::setWage(double wag){

	(*this).wage=(wag<0.0)?0.0:wag;
}
void HourEmployee::setHour(double h){
	(*this).hour=(((h>=0.0)&&(h<=168.0))?h:0);
}
double HourEmployee::earnings()const{
		
	if(getHour()<=40)
			return getWage()*getHour();
	else
		return 40*getWage()+((getHour()-40)*getWage()*1.5);
}
void HourEmployee::print()const{
	std::cout<<"Hour Employee:\n";
	Employee::print();
	std::cout<<"hour wage: "<<getWage()<<" hour worked: "<<getHour(); 
}
